package PTA_JAVA.JavaB.Javademo28;

import java.util.Random;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long seed = sc.nextLong();
        int n = sc.nextInt();
        Random r = new Random(seed);
        int count=0;
        for(int i=0;i<n;i++) {
            double x =r.nextDouble()*2-1;
            double y =r.nextDouble()*2-1;
            if ( Math.pow(x, 2) + Math.pow(y, 2)<=1) {
                count++;
            }
        }
        System.out.println(4*(double)count/n);
    }
}
